import { Connect } from './tools'
// const rootPath = 'http://120.77.66.252:8083/api';
const rootPath = Connect.newbaseURL


// const rootPath = 'http://savoro2o.hisense.com/api';
const imgPath = Connect.imgPath

var config = {
    rootPath: rootPath,
    imgPath: imgPath,
    oauth: rootPath + '/oauth/token',
    register: rootPath + '/mobile/user/register',
    deptTree: rootPath + '/depts/getJsonTree',
    depts: rootPath + '/depts',
    users: rootPath + "/users",
    changeDeptEmp: rootPath + '/users/changeDeptEmp',
    getType:rootPath + '/bg/gfc-get-type-by-codes/types',

    //菜单管理API
    menuTree: rootPath + '/menus/getJsonTree',
    menu: rootPath + "/menus",
    getMenu: rootPath + '/menus',
    updateMenu: rootPath + '/menus',
    addMenu: rootPath + '/menus',
    getRoleList: rootPath + '/roles/list',
    addMenuRole: rootPath + '/menus',
    menuTreeByUser: rootPath + "/menus/users/",

    //role
    postRole: rootPath + '/roles',
    getRoles: rootPath + '/roles',
    deleteRole: rootPath + '/roles',

    //定时任务
    getJobs: rootPath + '/job/queryjob',
    addJob: rootPath + '/job/addjob',
    rescheduleJob: rootPath + '/job/reschedulejob',
    pausejob: rootPath + '/job/pausejob',
    resumejob: rootPath + '/job/resumejob'

}

Date.prototype.Format = function (fmt) { //author: meizz 
    var o = {
        "M+": this.getMonth() + 1, //月份 
        "d+": this.getDate(), //日 
        "h+": this.getHours(), //小时 
        "m+": this.getMinutes(), //分 
        "s+": this.getSeconds(), //秒 
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
        "S": this.getMilliseconds() //毫秒 
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}

export default config;